from proj.tasks import add, mul, xsum, callback
from celery import group, chain, chord
import datetime

print(f"{'*'*10} start the app {'*'*10}")
print(datetime.datetime.now())
#res = mul.delay(3,3)
# kwargs里的参数需要与mul里的一致
res = mul.apply_async(kwargs={"y": 3, "x": 5}, link=add.s(5))
print("return:", res.get())
# print("callback return: ", res.children[0].get())#查看回调任务的结果
res = mul.apply_async((3, 5), link=callback.s("result").set(priority=1))
print(datetime.datetime.now())
print("return:", res.get())
res = mul.delay(3, 5)
print(datetime.datetime.now())
print("return:", res.get())
